﻿#region Using Directives

    using System;
    using System.Xml.Linq;

    using Csla;

    using MarketPulse.BusinessLogic.Core;
    using MarketPulse.BusinessLogic.Common.Criteria;

#endregion

namespace MarketPulse.BusinessLogic.Common
{
    /// <summary>
    /// This class represents a read only instance of an EnquiryActionType within the system.
    /// </summary>
    [Serializable]
    [Csla.Server.ObjectFactory("MarketPulse.DataAccess.Factory.EnquiryFactory, MarketPulse.DataAccess.Factory", "FetchActionInfo")]
    public class EnquiryActionTypeInfo : MarketPulseReadOnlyBase<EnquiryActionTypeInfo>
    {
        #region Member Variables

            /// <summary>
            /// The GUID of the Company (BusinessObject) associated with this EnquiryReason
            /// </summary>
            public static PropertyInfo<Nullable<Guid>> mCompanyGUIDProperty = RegisterProperty<Nullable<Guid>>(p => p.CompanyGUID);

            /// <summary>
            /// A human readable label for this EnquiryActionType
            /// </summary>
            public static PropertyInfo<XElement> mLabelProperty = RegisterProperty<XElement>(p => p.Label);

        #endregion

        #region Constructors

        /// <summary>
            /// Default constructor is private in order to (try to) enforce construction
            /// only via the static factory methods provided.
            /// </summary>
            private EnquiryActionTypeInfo()
            {
            }

        #endregion

        #region Methods

            #region Factory Methods

                ///// <summary>
                ///// Method used to retrieve a EnquiryActionTypeInfo object 
                ///// </summary>
                ///// <param name="enquiryActionTypeGuid">The guid of the EnquiryActionTypeInfo object to retrieve</param>
                ///// <returns>The populated EnquiryActionTypeInfo object</returns>
                //public static EnquiryActionTypeInfo Get(Guid enquiryActionTypeGuid)
                //{
                //    return DataPortal.Fetch<EnquiryActionTypeInfo>(new SingleCriteria<Guid>(enquiryActionTypeGuid));
                //}

            #endregion

        #endregion

        #region Properties

            #region Association GUID Properties (Foreign Keys)

                /// <summary>
                /// The GUID of the Company (BusinessObject) associated with this EnquiryReason
                /// </summary>
                public Nullable<Guid> CompanyGUID { get { return GetProperty(mCompanyGUIDProperty); } }

            #endregion

            /// <summary>
            /// A human readable label for this EnquiryActionType
            /// </summary>
            public XElement Label
            {
                get { return GetProperty(mLabelProperty); }
            }

        #endregion
    }
}
